using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace Cephei
{
    public interface ICell
    {
        void Lock ();
        void Unlock ();
        event CellChange Change;
        void OnChange (CellEventType eventType, ICell root, DateTime epoch, ITransaction transaction);
        bool HasListeners { get; }
        // The parent property provides for instruments to be composed of a number of cells
        IModel Parent { get; set; }
        String Mnmonic { get; set; }
        ITransaction Transaction { get; set; }
        CellMethod Method { get; }
        DateTime Epoch { get; }
        /// <summary>
        /// get the value of the Cell in a generic form
        /// </summary>
        object BoxValue { get; }
        /// <summary>
        /// copy the current state from the other cell of the same type as this one
        /// </summary>
        /// <param name="other">the other cell that has the same type</param>
        void Copy (ICell other);

        /// <summary>
        /// Transfer any subscriptions from this object to the new destination object 
        /// </summary>
        /// <param name="destination">the recipient of change subscriptions</param>
        void TransferTo (ICell destination);
    }
}
